﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace CC98
{
    public abstract class SingleInstanceObject
    {
        public SingleInstanceObject()
        {
            if (Interlocked.CompareExchange(ref this._isInstanced, 1, 0) != 0)
                throw new InvalidOperationException("Only one instance is allowed");
        }

        private int _isInstanced = 0;
    }
}
